FLAG_READ = ...
FLAG_WRITE = ...
FLAG_NOTIFY = ...

class BLE(object):
	"""
	Returns the singleton BLE object.
	"""
	...
	def active(self, active=None):
		"""
		Optionally changes the active state of the BLE radio, and returns the current state.

		The radio must be made active before using any other methods on this class.
		"""
		...
	
	def config(self, param):
		"""
		Get or set configuration values of the BLE interface. To get a value the parameter name should be quoted as a string, and just one parameter is queried at a time. To set values use the keyword syntax, and one ore more parameter can be set at a time.
		"""
		...

	def irq(self, handler, trigger=0xffff):
		"""
		Registers a callback for events from the BLE stack. The handler takes two arguments, event and data.

		The optional trigger parameter allows you to set a mask of events that your program is interested in. The default is all events.
		"""
		...
	
	def gap_advertise(self, interval_us, adv_data=None, resp_data=None, connectable=True):
		"""
		Starts advertising at the specified interval (in microseconds). This interval will be rounded down to the nearest 625us. To stop advertising, set interval_us to None.
		"""
		...
	
	def gap_scan(self, duration_ms, interval_us=None, window_us=None):
		"""
		Run a scan operation lasting for the specified duration (in milliseconds).

		To scan indefinitely, set duration_ms to 0.

		To stop scanning, set duration_ms to None.
		"""
		...
	
	def gatts_register_services(self, services_definition):
		"""
		Configures the peripheral with the specified services, replacing any existing services.
		"""
		...

	def gatts_read(self, value_handle):
		"""
		Reads the local value for this handle (which has either been written by gatts_write or by a remote central).
		"""
		...

	def gatts_write(self, value_handle, data):
		"""
		Writes the local value for this handle, which can be read by a central.
		"""
		...
	
	def gatts_notify(self, conn_handle, value_handle, data=None):
		"""
		Notifies a connected central that this value has changed and that it should issue a read of the current value from this peripheral.

		If data is specified, then the that value is sent to the central as part of the notification, avoiding the need for a separate read request. Note that this will not update the local value stored.
		"""
		...

	def gatts_indicate(self, conn_handle, value_handle, data=None, /):
		"""
		Sends a indication request to a connected client.

		If data is None (the default), then the current local value (as set with gatts_write) will be sent.

		Otherwise, if data is not None, then that value is sent to the client as part of the indication. The local value will not be modified.
		"""
		...

	def gatts_set_buffer(self, value_handle, len, append=False):
		"""
		Sets the internal buffer size for a value in bytes. This will limit the largest possible write that can be received. The default is 20.

		Setting append to True will make all remote writes append to, rather than replace, the current value.
		"""
		...
	
	def gap_connect(self, addr_type, addr, scan_duration_ms=2000):
		"""
		Connect to a peripheral.
		"""
		...
	
	def gap_disconnect(self, conn_handle):
		"""
		Disconnect the specified connection handle.
		"""
		...
	
	def gattc_discover_services(self, conn_handle):
		"""
		Query a connected peripheral for its services.
		"""
		...
	
	def gattc_discover_characteristics(self, conn_handle, start_handle, end_handle):
		"""
		Query a connected peripheral for characteristics in the specified range.
		"""
		...
	
	def gattc_discover_descriptors(self, conn_handle, start_handle, end_handle):
		"""
		Query a connected peripheral for descriptors in the specified range.
		"""
		...
	
	def gattc_read(self, conn_handle, value_handle):
		"""
		Issue a remote read to a connected peripheral for the specified characteristic or descriptor handle.
		"""
		...
	
	def gattc_write(self, conn_handle, value_handle, data, mode=0):
		"""
		Issue a remote write to a connected peripheral for the specified characteristic or descriptor handle.
		"""
		...

	def gattc_exchange_mtu(self, conn_handle, /):
		"""
		Issue a remote write to a connected server for the specified characteristic or descriptor handle.
		"""
		...

	def gap_pair(self, conn_handle, /):
		"""
		Initiate pairing with the remote device.

		Before calling this, ensure that the io, mitm, le_secure, and bond configuration options are set (via config).

		On successful pairing, the _IRQ_ENCRYPTION_UPDATE event will be raised.
		"""
		...

	def gap_passkey(self, conn_handle, action, passkey, /):
		"""
		Respond to a _IRQ_PASSKEY_ACTION event for the specified conn_handle and action.
		"""
		...


class UUID(object):
	"""
	Creates a UUID instance with the specified value.
	"""
	...
	def __init__(self, value):
		...
